<template>
<div class="duizhang">

  <h2>对账批次查询</h2>

  <div style="width: 1100px;margin-left: 50px">

  <el-form :model="form" :inline="true">
    <el-form-item label="账单日:">
      <el-date-picker
        v-model="form.startDate"
        value-format="yyyy-MM-dd"
        placeholder="选择日期">
      </el-date-picker>
    </el-form-item>
    <el-form-item label="至">
      <el-date-picker
        v-model="form.endDate"
        value-format="yyyy-MM-dd"
        placeholder="选择日期">
      </el-date-picker>
    </el-form-item>
    <el-form-item>
      <el-button type="warning" @click="initData()">查询</el-button>
    </el-form-item>
  </el-form>

    <el-table
      :data="tableData"
      style="border: 1px solid black">
      <el-table-column
        prop="batchNo"
        label="对账批次"
        width="180">
      </el-table-column>
      <el-table-column
        prop="billDay"
        label="账单日"
        width="180">
      </el-table-column>
      <el-table-column
        label="账单类型">
        <template slot-scope="scope">
          <span v-if="scope.row.billType==2">认证支付</span>
          <span v-if="scope.row.billType==1">代付</span>
          <span v-if="scope.row.billType==4">支付宝</span>
          <span v-if="scope.row.billType==3">微信</span>
        </template>
      </el-table-column>
      <el-table-column
        label="渠道名称">拉卡拉
      </el-table-column>
      <el-table-column
        prop="checkCount"
        label="渠道对账文件交易数量">
      </el-table-column>
      <el-table-column
        prop="orderCount"
        label="系统交易流水数量">
      </el-table-column>
      <el-table-column
        prop="diffCount"
        label="差错账数量">
      </el-table-column>
      <el-table-column
        prop="checkDay"
        label="对账日期">
      </el-table-column>
      <el-table-column
        label="生成方式">
        <template slot-scope="scope">
          <span v-if="scope.row.createType==1">自动</span>
          <span v-if="scope.row.createType==2">手动</span>
        </template>
      </el-table-column>
      <el-table-column
        label="是否完成对账">
        <template slot-scope="scope">
          <span v-if="scope.row.completeState==1">完成</span>
          <span v-if="scope.row.completeState==2">未完成</span>
          <span v-if="scope.row.completeState==3">取消</span>
        </template>
      </el-table-column>
      <el-table-column
        prop="confirmDate"
        label="对账确认时间">
      </el-table-column>
    </el-table>

    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="current"
      :page-sizes="sizes"
      :page-size="size"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total">
    </el-pagination>
  </div>

</div>
</template>

<script>
import {allList} from "@/api/wishu/duizhang";

export default {
  name: "duizhang",
  data(){
    return{
      form:{},
      tableData:[],
      current:1,
      sizes:[2,3,5,10],
      size:5,
      total:0,
    }
  },
  created() {
    this.initData();
  },
  methods:{
    initData(){
      allList(this.current,this.size,this.form).then((res)=>{
        this.tableData=res.records;
        this.total=res.total;
      })
    },
    handleSizeChange(val) {
      this.size=val;
      this.initData();
    },
    handleCurrentChange(val) {
      this.current=val;
      this.initData();
    }
  }
}
</script>

<style scoped>

</style>
